home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / New System Software Extensions / QuickDraw™ GX 1.1.2 / Programming Stuff / Development & Debugging Tools / Virtual User scripts / GX Printer Test Suites / MainScript.vu < prev   
Encoding:
Text File  |  1995-04-10  |  10.8 KB  |  366 lines  |  [TEXT/MPS ]

  1. ##################################################################################################################
  2. ##     General LaserWriter GX printing test script    for Virtual User test environment                                ##
  3. ##################################################################################################################
  4. ##            Developed by Brad Reigel and Scott Cutler, Apple Computer, Inc.                                        ##
  5. ##################################################################################################################
  6. ##            Last Modified July 19, 1994                                                                            ##
  7. ##################################################################################################################
  8. ## See Main.lib for descriptions of all routines.                                                                ##
  9. ##                                                                                                                ##
  10. ## This test expects a folder (or alias to folder) named " Documents" in the Apple Menu.                        ##
  11. ## After opening document, the script selects and prints with different options selected.                        ##
  12. ## When finished, application is closed, and next document in folder is opened.                                    ##
  13. ##                                                                                                                ##
  14. ## This script will work with the majority of applications.  However, because of the hacks                        ##
  15. ## which some applications use on print dialogs, some tweaking of this script may be required.                    ##
  16. ##################################################################################################################
  17.  
  18. Libraries "Main.lib";
  19.  
  20. println "# Initializing…";
  21. Initialize();
  22.  
  23. kNumDocuments := 6;
  24. for x := 1 to kNumDocuments
  25. begin
  26.  
  27.     DialogAction    ( "OK" );
  28.     println "# Document ", x;
  29.  
  30.     #### Test 1 Portrait #####################################################
  31.     println "# Test 1 Portrait";
  32.     println "#    Page Setup…";
  33.     select [menuItem t:/Page Setup/ m:"File"];
  34.  
  35.     SetPaper        ( "US Letter" );
  36.     SetOrientation    ( "Portrait" );
  37.     SetScale        ( 100 );
  38.  
  39.         #### Additional Options from within Page Setup
  40.         #### Turn off all options for first 9 tests
  41.         select [button t:"Options"]!;
  42.         SetOptions    ( false, false, false, false );
  43.         type k: { returnKey };
  44.  
  45.     println "#    Print…";
  46.     select [menuItem t:/Print/ m:"File"];
  47.  
  48.     SetCopies        ( 1 );
  49.     SetPages        ( "All", "", "" );
  50.     SetCoverPage    ( "No" );
  51.     SetPaperSource    ( "Paper Cassette" );
  52.     SetDestination    ( "Printer", "", "", "" );
  53.     println "#      Synchronizing…";
  54.     while (DialogPresent());
  55.     results := PrintingEnabled();
  56.     while not (results)
  57.         results := PrintingEnabled();
  58.  
  59.     #### Test 2 Landscape ####################################################
  60.     println "# Test 2 Landscape";
  61.     println "#    Page Setup…";
  62.     select [menuItem t:/Page Setup/ m:"File"];
  63.     
  64.     SetPaper        ( "US Letter" );
  65.     SetOrientation    ( "Landscape" );
  66.     SetScale        ( 100 );
  67.     type k: { returnKey };
  68.     
  69.     println "#    Print…";
  70.     select [menuItem t:/Print/ m:"File"];
  71.     DialogAction    ( "OK" );
  72.     
  73.     SetCopies        ( 1 );
  74.     SetPages        ( "All", "", "" );
  75.     SetCoverPage    ( "No" );
  76.     SetPaperSource    ( "Paper Cassette" );
  77.     SetDestination    ( "Printer", "", "", "" );
  78.     println "#      Synchronizing…";
  79.     while (DialogPresent());
  80.     results := PrintingEnabled();
  81.     while not (results)
  82.         results := PrintingEnabled();
  83.  
  84.     #### Test 3 Reduced ######################################################
  85.     println "# Test 3 Reduced";
  86.     println "#    Page Setup…";
  87.     select [menuItem t:/Page Setup/ m:"File"];
  88.     
  89.     SetPaper        ( "US Letter" );
  90.     SetOrientation    ( "Portrait" );
  91.     SetScale        ( 64 );
  92.     type k: { returnKey };
  93.     
  94.     println "#    Print…";
  95.     select [menuItem t:/Print/ m:"File"];
  96.     
  97.     SetCopies        ( 1 );
  98.     SetPages        ( "All", "", "" );
  99.     SetCoverPage    ( "No" );
  100.     SetPaperSource    ( "Paper Cassette" );
  101.     SetDestination    ( "Printer", "", "", "" );
  102.     println "#      Synchronizing…";
  103.     while (DialogPresent());
  104.     results := PrintingEnabled();
  105.     while not (results)
  106.         results := PrintingEnabled();
  107.  
  108.     #### Test 4 Enlarged #####################################################
  109.     println "# Test 4 Enlarged";
  110.     println "#    Page Setup…";
  111.     select [menuItem t:/Page Setup/ m:"File"];
  112.     
  113.     SetPaper        ( "US Letter" );
  114.     SetOrientation    ( "Portrait" );
  115.     SetScale        ( 200 );
  116.     type k: { returnKey };
  117.     
  118.     println "#    Print…";
  119.     select [menuItem t:/Print/ m:"File"];
  120.     
  121.     SetCopies        ( 1 );
  122.     SetPages        ( "All", "", "" );
  123.     SetCoverPage    ( "No" );
  124.     SetPaperSource    ( "Paper Cassette" );
  125.     SetDestination    ( "Printer", "", "", "" );
  126.     println "#      Synchronizing…";
  127.     while (DialogPresent());
  128.     results := PrintingEnabled();
  129.     while not (results)
  130.         results := PrintingEnabled();
  131.     
  132.     #### Test 5 Multiple Copies ##############################################
  133.     println "# Test 5 Multiple Copies";
  134.     println "#    Page Setup…";
  135.     select [menuItem t:/Page Setup/ m:"Disk File"];
  136.     
  137.     SetPaper        ( "US Letter" );
  138.     SetOrientation    ( "Portrait" );
  139.     SetScale        ( 100 );
  140.     type k: { returnKey };
  141.     
  142.     println "#    Print…";
  143.     select [menuItem t:/Print/ m:"Disk File"];
  144.     
  145.     SetCopies        ( 5 );
  146.     SetPages        ( "All", "", "" );
  147.     SetCoverPage    ( "No" );
  148.     SetDestination    ( "Printer", "", "", "" );
  149.     println "#      Synchronizing…";
  150.     while (DialogPresent());
  151.     results := PrintingEnabled();
  152.     while not (results)
  153.         results := PrintingEnabled();
  154.     
  155.     #### Test 6 Disk File 1 ##################################################
  156.     println "# Test 6 Disk File (PDD)";
  157.     println "#    Page Setup…";
  158.     select [menuItem t:/Page Setup/ m:"Disk File"];
  159.     
  160.     SetPaper        ( "US Letter" );
  161.     SetOrientation    ( "Portrait" );
  162.     SetScale        ( 100 );
  163.     type k: { returnKey };
  164.     
  165.     println "#    Print…";
  166.     select [menuItem t:/Print/ m:"Disk File"];
  167.     
  168.     SetCopies        ( 1 );
  169.     SetPages        ( "All", "", "" );
  170.     SetCoverPage    ( "No" );
  171.     SetPaperSource    ( "Paper Cassette" );
  172.     SetDestination    ( "Disk File", "Print File {x}", true, false );
  173.     println "#      Synchronizing…";
  174.     while (DialogPresent());
  175.     results := PrintingEnabled();
  176.     while not (results)
  177.         results := PrintingEnabled();
  178.     
  179.     #### Test 7 Disk File 2 ##################################################
  180.     println "# Test 7 Disk File (PDD fonts)";
  181.     println "#    Page Setup…";
  182.     select [menuItem t:/Page Setup/ m:"Disk File"];
  183.     
  184.     SetPaper        ( "US Letter" );
  185.     SetOrientation    ( "Portrait" );
  186.     SetScale        ( 100 );
  187.     type k: { returnKey };
  188.     
  189.     println "#    Print…";
  190.     select [menuItem t:/Print/ m:"Disk File"];
  191.     
  192.     SetCopies        ( 1 );
  193.     SetPages        ( "All", "", "" );
  194.     SetCoverPage    ( "No" );
  195.     SetPaperSource    ( "Paper Cassette" );
  196.     SetDestination    ( "Disk File", "Print File (fonts) {x}", true, true );
  197.     println "#      Synchronizing…";
  198.     while (DialogPresent());
  199.     results := PrintingEnabled();
  200.     while not (results)
  201.         results := PrintingEnabled();
  202.     
  203.     #### Test 8 Disk File 3 ##################################################
  204.     println "# Test 8 Disk File (PostScript)";
  205.     println "#    Page Setup…";
  206.     select [menuItem t:/Page Setup/ m:"Disk File"];
  207.     
  208.     SetPaper        ( "US Letter" );
  209.     SetOrientation    ( "Portrait" );
  210.     SetScale        ( 100 );
  211.     type k: { returnKey };
  212.     
  213.     println "#    Print…";
  214.     select [menuItem t:/Print/ m:"Disk File"];
  215.     
  216.     SetCopies        ( 1 );
  217.     SetPages        ( "All", "", "" );
  218.     SetCoverPage    ( "No" );
  219.     SetPaperSource    ( "Paper Cassette" );
  220.     SetDestination    ( "Disk File", "PostScript® File {x}", false, false );
  221.     println "#      Synchronizing…";
  222.     while (DialogPresent());
  223.     results := PrintingEnabled();
  224.     while not (results)
  225.         results := PrintingEnabled();
  226.     
  227.     #### Test 9 Disk File 4 ##################################################
  228.     println "# Test 9 Disk File (PostScript fonts)";
  229.     println "#    Page Setup…";
  230.     select [menuItem t:/Page Setup/ m:"Disk File"];
  231.     
  232.     SetPaper        ( "US Letter" );
  233.     SetOrientation    ( "Portrait" );
  234.     SetScale        ( 100 );
  235.     type k: { returnKey };
  236.     
  237.     println "#    Print…";
  238.     select [menuItem t:/Print/ m:"Disk File"];
  239.     
  240.     SetCopies        ( 1 );
  241.     SetPages        ( "All", "", "" );
  242.     SetCoverPage    ( "No" );
  243.     SetPaperSource    ( "Paper Cassette" );
  244.     SetDestination    ( "Disk File", "PostScript® File (fonts)   {x}", false, true );
  245.     println "#      Synchronizing…";
  246.     while (DialogPresent());
  247.     results := PrintingEnabled();
  248.     while not (results)
  249.         results := PrintingEnabled();
  250.         
  251.     #### Test 10 Flip Horizontal #############################################
  252.     println "# Test 10 Flip Horizontal";
  253.     println "#    Page Setup…";
  254.     select [menuItem t:/Page Setup/ m:"Disk File"];
  255.     
  256.     SetPaper        ( "US Letter" );
  257.     SetOrientation    ( "Portrait" );
  258.     SetScale        ( 100 );
  259.     
  260.         #### Additional Options from within Page Setup
  261.         select [button t:"Options"]!;
  262.         SetOptions    ( true, false, false, false );
  263.         type k: { returnKey };
  264.     
  265.     println "#    Print…";
  266.     select [menuItem t:/Print/ m:"Disk File"];
  267.     
  268.     SetCopies( 1 );
  269.     SetPages        ( "All", "", "" );
  270.     SetCoverPage    ( "No" );
  271.     SetPaperSource    ( "Paper Cassette" );
  272.     SetDestination    ( "Printer", "", "", "" );
  273.     println "#      Synchronizing…";
  274.     while (DialogPresent());
  275.     results := PrintingEnabled();
  276.     while not (results)
  277.         results := PrintingEnabled();
  278.     
  279.     #### Test 11 Flip Vertical ###############################################
  280.     println "# Test 11 Flip Vertical";
  281.     println "#    Page Setup…";
  282.     select [menuItem t:/Page Setup/ m:"Disk File"];
  283.     
  284.     SetPaper        ( "US Letter" );
  285.     SetOrientation    ( "Portrait" );
  286.     SetScale        ( 100 );
  287.     
  288.         #### Additional Options from within Page Setup
  289.         select [button t:"Options"]!;
  290.         SetOptions    ( false, true, false, false);
  291.         type k: { returnKey };
  292.     
  293.     println "#    Print…";
  294.     select [menuItem t:/Print/ m:"Disk File"];
  295.     
  296.     SetCopies        ( 1 );
  297.     SetPages        ( "All", "", "" );
  298.     SetCoverPage    ( "No" );
  299.     SetPaperSource    ( "Paper Cassette" );
  300.     SetDestination    ( "Printer", "", "", "" );
  301.     println "#      Synchronizing…";
  302.     while (DialogPresent());
  303.     results := PrintingEnabled();
  304.     while not (results)
  305.         results := PrintingEnabled();
  306.     
  307.     #### Test 12 Invert Image ################################################
  308.     println "# Test 12 Invert Image";
  309.     println "#    Page Setup…";
  310.     select [menuItem t:/Page Setup/ m:"Disk File"];
  311.     
  312.     SetPaper        ( "US Letter" );
  313.     SetOrientation    ( "Portrait" );
  314.     SetScale        ( 100 );
  315.     
  316.         #### Additional Options from within Page Setup
  317.         select [button t:"Options"]!;
  318.         SetOptions    ( false, false, true, false );
  319.         type k: { returnKey };
  320.     
  321.     println "#    Print…";
  322.     select [menuItem t:/Print/ m:"Disk File"];
  323.     
  324.     SetCopies        ( 1 );
  325.     SetPages        ( "All", "", "" );
  326.     SetCoverPage    ( "No" );
  327.     SetPaperSource    ( "Paper Cassette" );
  328.     SetDestination    ( "Printer", "", "", "" );
  329.     println "#      Synchronizing…";
  330.     while (DialogPresent());
  331.     results := PrintingEnabled();
  332.     while not (results)
  333.         results := PrintingEnabled();
  334.     
  335.     #### Test 13 Precision Bitmap Alignment ##################################
  336.     println "# Test 13 Precision Bitmap Alignment";
  337.     println "#    Page Setup…";
  338.     select [menuItem t:/Page Setup/ m:"Disk File"];
  339.     
  340.     SetPaper        ( "US Letter" );
  341.     SetOrientation    ( "Portrait" );
  342.     SetScale        ( 100 );
  343.     
  344.         #### Additional Options from within Page Setup
  345.         select [button t:"Options"]!;
  346.         SetOptions    ( false, false, false, true );
  347.         type k: { returnKey };
  348.     
  349.     println "#    Print…";
  350.     select [menuItem t:/Print/ m:"Disk File"];
  351.     
  352.     SetCopies        ( 1 );
  353.     SetPages        ( "All", "", "" );
  354.     SetCoverPage    ( "No" );
  355.     SetPaperSource    ( "Paper Cassette" );
  356.     SetDestination    ( "Printer", "", "", "" );
  357.     println "#      Synchronizing…";
  358.     while (DialogPresent());
  359.     results := PrintingEnabled();
  360.     while not (results)
  361.         results := PrintingEnabled();
  362.     
  363.     Quit();
  364.     println "#   Loading next file…";
  365.     LoadNextDocument();
  366. end;